from dataclasses import dataclass
from typing import TYPE_CHECKING, List, NewType, final

if TYPE_CHECKING:
    from server.apps.blogs.models import Category, Tag

#: We use this type to differentiate `1` as a number and `1` as `BlogPost` id.
BlogPostId = NewType('BlogPostId', int)

#: We use this type to differentiate integers from valid ratings.
ValidScore = NewType('ValidScore', int)


@final
@dataclass(frozen=True, slots=True)
class ValidPostData(object):
    """Used to represent valid data that we can use to create a post."""

    title: str
    body: str
    author: str
    # is_published: bool
    # category: "Category"
    # tags: List["Tag"]
